home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_gen_nearmisstalk.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
3KB
|
121 lines
# Jones 3D Cog Script
#
# gen_NearMissTalk.cog
#
# Indy notes almost succeeding
#
# [HB]
#
# (C) 1999 LucasArts Entertainment Co. All Rights Reserved
# ==============================================================================
# NOTE: This is a random verbal reaction when Indy's efforts almost succeed.
# Glue it into your level and reach it from a calling cog like this:
#
# 1. Create a valid reference to this cog in your calling cog;
#
# 2. Use the following verb:
# SendMessageEx(thiscogREF, i_userMessage, f_parm0, f_parm1, f_parm2, f_parm3);
# (see each section below for details...)
#
# 3. Use global15 as a semaphore and return value where neeeded;
#
# The resulting chatter is pre-approved by HB...
#
# PRODUCT SUPPORT: cogsrus x8371
# ==============================================================================
symbols
# ................................. MESSAGES ...................................
message user0 # near miss lines
# ................................. SAY LINES ..................................
# near miss lines...
sound in_sayline=Inxj093.wav local # Good idea-->in_sayline[0]
sound in_perfectnot=Inxj094.wav local # Perfect world...but not this one
sound in_mustbediff=Inxj095.wav local # Must be a different way
sound in_notquite=Inxj092.wav local # Hmm, didn't quite work
# ............................... VARIABLES ....................................
flex talkerREF local
flex forceTalk local
flex forceLine local
int alreadyworking=0 local
int newline=50 local # init outside actual range
int oldline=50 local
int errorstop=0 # RKD: used to keep Marcus from asking for references
end
# ==============================================================================
code
user0:
# NOTE: Indy expresses DOUBT that something he tries will work...
# (Useful when Indy does something so offbeat that it doesn't
# even qualify as a legitimate failed attempt)
#
# Proper command to reach this response section from the calling cog is:
#
# SendMessageEx(negtalkcogREF, user0, f_talkerREF, f_forceTalk, f_forceLine, 0);
#
# global15 is used here like so:
#
# global15 == 0 while this cog is at work (waiting for line to finish)
# global15 == 1 upon return
#
# As discussed in user0 section, the calling cog can use global15 as a semaphore
#
# Hey! You can also force a line choice. Here's how:
# 1. Note your intention by setting f_forceTalk parm to some non-zero value
# 2. Examine the available lines to find the one you want (counting from 0)
# 3. Pass that number in the forceLine parameter (parm2)
if (alreadyworking > 0)
{
return;
}
alreadyworking = 1; # stall multiple calls
global15 = 0; # init each call
talkerREF = GetParam(0); # is player or an actor talking? (a cast)
forceTalk = GetParam(1); # force a choice
forceLine = GetParam(2); # actual line choice
if (forceTalk > 0)
{
newline = forceLine; # choose this line
oldline = 0;
}
while (newline == oldline)
{
newline = RandBetween(0, 3);
}
oldline = newline; # remember choice
PlayVoice(talkerREF, in_sayline[newline], 1, 1);
global15 = 1;
alreadyworking = 0;
# RKD: prevent Marcus from asking about new symbols and cogsniffer from reporting unused symbol
errorstop = 0;
return;
end